package com.matou.auth.properties;

import lombok.Data;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;

import java.io.Serializable;

/**
 * @Author CM
 * @Date 2021/5/9 8:57
 * @Description CmAuthProperties auth 相关配置类
 * @Version 1.0
 */
@Data
/**
 * 注入ioc容器
 */
@SpringBootConfiguration
/**
 * 指定配置文件零
 */
@PropertySource(value = {"classpath:cm-auth.properties"})
@ConfigurationProperties(prefix = "cm.auth")
public class CmAuthProperties implements Serializable {

    /**
     * 权限认证信息
     */
    private CmClientsProperties[] clients = {};
    /**
     * 请求token 有效期
     */
    private int accessTokenValiditySeconds = 60 * 60 * 24;
    /**
     * 刷新token 有效期
     */
    private int refreshTokenValiditySeconds = 60 * 60 * 24 * 7;

    /**
     * 免认证路径
     */
    private String anonUrl;

    /**
     * 验证码配置类
     */
    private CmValidateCodeProperties code = new CmValidateCodeProperties();
}
